﻿namespace Jerky.Extension;

/// <summary>
/// 字符串扩展类
/// </summary>
public static class StringExtensions
{
    /// <summary>
    /// 移除字符串末尾的数字
    /// </summary>
    /// <param name="input">输入字符串</param>
    /// <returns>移除末尾数字后的字符串</returns>
    public static string RemoveTrailingDigits(this string input)
    {
        if (string.IsNullOrEmpty(input))
        {
            return input;
        }

        return Regex.Replace(input, @"\d+$", "");
    }
}